//
// Created by liushuai on 2021/2/25.
//

#include "minMoves.h"

int minMoves(vector<int>& nums) {
<<<<<<< HEAD:cxx/algorithm/src/minMoves.cc
    int res = 0;
    int min = *std::min_element(nums.begin(),nums.end());
    for(auto e:nums){
        res+=e-min;
    }
    return res;
=======
  int res = 0;
  int min = *std::min_element(nums.begin(), nums.end());
  for (auto e : nums) {
    res += e - min;
  }
  return res;
>>>>>>> dev:cxx/algorithm/common/src/minMoves.cc
}